package com.zbiti.anvil.basic.module.business.rest.controller;

import com.zbiti.module.common.api.service.IBaseService;
import com.zbiti.module.common.rest.controller.IBaseController;
import com.zbiti.anvil.basic.module.business.api.domain.SamplesLeaveDomain;
import com.zbiti.anvil.basic.module.business.api.service.ISamplesLeaveService;
import com.zbiti.sdk.common.domain.RestDomain;
import com.zbiti.anvil.wf.rest.common.IWfRestartTemplateController;
import com.zbiti.anvil.wf.rest.common.IWfStartTemplateController;
import com.zbiti.anvil.wf.api.template.atom.IWfReStartTemplate;
import com.zbiti.anvil.wf.api.template.atom.IWfStartTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 示例：请假申请流程对外Rest风格Controller
 *
 * @author Fanyc
 * @date 2022-04-09 18:50:20
 */
@RestController
@RequestMapping("/samples/leave")
public class SamplesLeaveController implements IBaseController<SamplesLeaveDomain>
        , IWfStartTemplateController<SamplesLeaveDomain>
        , IWfRestartTemplateController<SamplesLeaveDomain> {

    /**
     * 操作服务对象
     */
    @Autowired
    private ISamplesLeaveService iSamplesLeaveService;

    /**
     * 获取通用操作Service
     *
     * @return 操作Service
     */
    @Override
    public IBaseService<SamplesLeaveDomain> getIBaseService() {
        return iSamplesLeaveService;
    }

    /**
     * 获取流程模板服务
     *
     * @return 流程模板服务
     */
    @Override
    public IWfStartTemplate<SamplesLeaveDomain> getWfStartTemplate() {
        return iSamplesLeaveService;
    }

    /**
     * 获取流程模板服务
     *
     * @return 流程模板服务
     */
    @Override
    public IWfReStartTemplate<SamplesLeaveDomain> getWfReStartTemplate() {
        return iSamplesLeaveService;
    }
}
